package com.zhu.storesmanager.models;

import java.util.Date;
import java.util.List;

public class SyncModel {

	//数据获取成功状态标志
    public static final int FAIL_NETWORK = -1; //网络失败
    public static final int FAIL_DATA = 0; //接口返回错误
	public static final int SUCCEED = 1;
	public static final int SUCCEED_PUTTED = 2; //已经上传

	public static final int TYPE_SYNC_ALL = 1; //同步所有
	public static final int TYPE_SYNC_REMIND = 2; //同步提醒

	/**
	 * 返回状态
	 */
	public static class ResultStatus{
	    public int Status;          //状态  1:成功; 0：失败; 2:其它
        public String Msg;          //状态为0、2时，返回消息;状态为1时，返回null
	}

    //登录
    public static class LoginRequest
    {
        public String LoginName;    //登录名
        public String Password;     //密码
        public String Version;      //App版本号, 如： 1.01, 1.02
        public String Imei;         //手机IMEI号
        public String AppType; //ANDROID OR IOS
    }

    /**
     * 登录结果
     */
    public static class LoginResData
    {
        public String Uuid;			//Uuid
        public String RealName;		//姓名
        public int RoleType;		//角色类型 1-GPS督导;2-GPS促销员;3-GPS管理员
        public String CounterName;	//门店名称
        public int CounterTarget;	//门店目标
        public int Upgrade;         //是否需要升级， 1:需要; 0:不需要
        public long FileSize;       //文件大小
        public int ClearCache;//清空手机端保存的拜访内容 //1:清空 0:不清空
        public int AppType;
    }

    /**
     * 登录结果
     */
    public static class LoginResult extends ResultStatus
    {
        public LoginResData Data;        
    }

    /**
     * 安全请求
     */
    public static class SecureRequest
    {
        public String LoginName;
    }

    /**
     * 安全结果返回
     */
    public static class SecureResult extends ResultStatus
    {
        public String PublicKey;
        public String Modulus;
    }

    //开始同步
  	public static class StartRequest
    {
        public String Uuid;      	//Uuid 
        public int First;           //是否是第一次同步 1:第一次;0：非第一次
    }

  	/**
  	 * 开始同步结果
  	 */
    public static class StartResult extends ResultStatus
    {
        public Date SyncTime;		//同步时间
    }

    //获取型号
  	public static class ProductRequest
    {
        public String Uuid;			//Uuid
    }

  	//获取型号结果
    public static class ProductResult extends ResultStatus
    {
        //public ProductModelResData Data;
    	public List<String> Models;		//添加或修改的型号
    }

    public static class ProductModelResData
    {
        public List<String> Models;		//添加或修改的型号
        //public List<String> Deled;	//删除的型号
    }
    
    //促销员签入
    public static class PromoterCheckRequest
    {
        public String Uuid;				//Uuid
        public Date WorkDate;			//日期
        public Date CheckInTime;		//签入时间
        public double CheckInLongitude;	//签入经度
        public double CheckInLatitude;	//签入维度
        public Date MobileTime;			//手机时间
    }

    //完成同步
    public static class FinishRequest
    {
        public String Uuid;							//Uuid
        public Date SyncTime;						//同步时间
        public int Type; //1 所有数据 2提醒
    }

    //上报销量
    public static class PromoterSalesRequest
    {
        public String Uuid;							//Uuid
        public String SalesDes; //加密销量
        //public List<PromoterSalesReqModel> Sales;	//型号销量
    }

    public static class PromoterSalesReqModel
    {
        public String Model;						//型号
        public int Num;								//销量
        public int Amount;								//销量
    }

    public static class PromoterSalesResult extends ResultStatus
    {
        public Date SaleDate;       //同步时间
    }

     //获取服务器时间
    public static class TimeRequest
    {
        public String Uuid;                         //Uuid
    }

    public static class TimeResult extends ResultStatus
    {
        public Date ServerTime;                 //服务器时间
    }

    //数据字典
    public static class DictRequest
    {
        public String Uuid; //Uuid
    }

    public static class DictResult extends ResultStatus
    {
        public List<ResDict> Data; //数据词典数据
    }

    public static class ResDict
    {
        public int TypeId; //类型ID
        public String TypeName; //类型名字
        public List<String> Items; //词典项集合
    }

    //拜访项目
    public static class ProjectRequest
    {
        public String Uuid; //Uuid
    }

    public static class ProjectResult extends ResultStatus
    {
        public List<ResProject> Data; //项目结果数据
    }

    public static class ResProject
    {
        public int TypeId; //类型ID
        public String TypeName; //类型名字
        public List<ResProjectItem> Items; //项目集合
    }

    public static class ResProjectItem
    {
        public int Sequence; //排序
        public String Name; //名字
        public boolean IsShow; //是否显示
        public boolean IsSave;  //是否保存
    }

    //提醒
    public static class ReminderRequest
    {
        public String Uuid; //Uuid
    }

    public static class ReminderResult extends ResultStatus
    {
        public List<ResReminder> Data; //提醒数据
    }


    public static class ResReminder
    {
    	public int Id;
        public int Type; //提醒类型
        public String CounterCode; //门店代码
        public String Content; //门店类容
        public Date RemindDate; //提醒日期
        public Date Deadline; //到期日期
        public String RangeName; //组织架构
    }

    //拜访任务
    public static class VisitRequest
    {
        public String Uuid; //Uuid
    }

    public static class VisitResult extends ResultStatus
    {
        public List<ResVisit> Data; //拜访数据
    }

    public static class ResVisit
    {
        public int Id; //任务ID
        public String CounterCode; //门店代码
        public String CounterName; //门店名字
        public Date VisitDate; //拜访日期
        public List<ResVisitPromoter> Promoters; //促销员信息
    }

    //门店促销员信息
    public static class ResVisitPromoter
    {
        public String PromoterCode; //促销员编号
        public String PromoterName; //促销员名字
    }

    //督导门店拜访拜访信息
    public static class VisitCheckRequest
    {
    	 public String Uuid;
    	 public int VisitId;
         public Date CheckInTime;		//签入时间
         public String CheckInStatus;
         public double CheckInLongitude;	//签入经度
         public double CheckInLatitude;	//签入维度 

         public Date CheckOutTime;  //签入时间
         public String CheckOutStatus;
         public double CheckOutLongitude; //签入经度
         public double CheckOutLatitude; //签入维度 
         
         public Date MobileTime;			//手机时间
    }

    //门店拜访内容
    public static class VisitContentReqeust
    {
        public String Uuid;
        public int VisitId;
        public VisitContentReqData Data;
        public List<DataVisitContentCompetitor> CompPrices;        //竞品产品价格
        public List<DataVisitContentCompetitor> CompNews;          //新品上市信息
        public List<DataVisitContentCompetitor> CompPromotions;    //竞品促销活动
        public List<DataVisitContentPromoter> Promoters;    //促销员信息
    }

    public static class VisitContentReqData
    {
        public int SampleDisplayNum;        //样机出样数量
        public int SampleEmptyNum;          //样机空样数量
        public List<String> ThemeModels;          	//主题形象墙出样型号
        public List<String> OvercolorModels;        //流光溢彩墙型号
        public List<String> OtherModels;	       	//其他出样型号
        public String DemoDigitalStream;		       //演示数码流情况 -1未选中

        public String BoothsShape;             //展台形状
        public String BoothsLocation;          //展台信息
        public String BoothsBreakageItem;      //展台破损项目
        public Date BoothsBreakageDate;   //展台破损日期
        public String BoothsBreakageStatus;    //展台破损是否完工
        public String WireExposed;             //连线是否外露
        public String BoothsView;              //展台全景(照片)
        public String BoothsFacade;            //展台正面(照片)
        public String BoothsOvercolor;         //展台流光溢彩墙(照片)

        /*
        public String SaleMonth;               //销售年月(201308)
        public int SaleNum;                    //总销量
        public int SaleAmount;                 //总金额
        public List<DataVisitContentSales> Sales;   //品牌销售 */
        public String SalesDes;   //品牌销售

        public String LedgerGatherStatus;      //台账收集成功:是或否
        public String LedgerCheckStatus;       //台账核对无误:是或否
        public String CounterStockStatus;      //门店库存情况:充足或缺乏
        public List<String> OutOfStockModels;       //缺货型号


        public String SampleCornerPost;        //样机角贴:齐, 缺,破损,不允许
        public String PosterHang;              //海报及吊旗悬挂:齐, 缺,破损,不允许
        public String SinglePage;              //单页:齐, 缺,破损,不允许
        public String StandPileHead;           //X展架及堆头布置:齐, 缺,破损,不允许
        public String ExceptionDetails;        //异常详情
        public List<DataVisitContentSpecial> PosmBackups;               //Posm备用
        public List<DataVisitContentSpecial> Specials;      //特殊任务
    }

    public static class DesDataVisitContentSales
    {
        public String SaleMonth;
        public int SaleNum; //销量
        public int SaleAmount; //销售金额
    	public List<DataVisitContentSales> Sales;   //品牌销售
    }
    
    public static class DataVisitContentSales
    {
        public String Brands;				//销售品牌
        public int BrandsSaleNum;			//销售数量
        public int BrandsSaleAmount;		//销售金额
    }

    public static class DataVisitContentSpecial
    {
        public String Title; //任务描述
        public String Value; //任务反馈
    }

    public static class DataVisitContentPromoter
    {
        public String PromoterCode;        //促销员ID
        public String PromoterName;        //促销员名字
        public String DutyStatus;          //在岗情况:是/否/休
        public String Appearance;          //促销员形象:好/较好/差
        public String Performance;         //促销员状态:好/不好
        public String NotGoodReason;       //不好原因
        public String Attendance;          //促销员考勤:全勤/病假/事假/休/产
        public String TemporaryPromoter ;   //临促情况:是/否/无（选择是或否需填写：临促姓名/电话/不在岗原因，文字框）
        public String TempName;            //临促姓名
        public String TempMobile;          //电话
        public String OffDutyReason;       //不在岗原因
        public String Question;            //促销员问题
        public String Photo;               //促销员照片（非必拍）
    }

    public static class DataVisitContentCompetitor
    {
        public String Type; //类型
        public String Brands; //品牌
        public String Model;  //型号
        public double Price; //价格
        public int SaleNum;  //销量
        public String Function; //功能 
        public String OtherFunction; //其他功能
        public String Activity; //活动
        public String OtherActivity; //其他活动
        public String Photo;  //照片
    }

  //区域查询,返回所有区域、分办、渠道
    public static class QueryRegionRequest
    {
        public String Uuid;
    }

    public static class QueryRegionResult extends ResultStatus
    {
        public ResQueryRegionData Data;
    }

    public static class ResQueryRegionData
    {
        public List<ResRegion> Regions;    //区域
        public List<ResBranch> Branchs;    //分办
        public List<ResChannel> Channels;  //渠道
    }

    public static class ResRegion
    {
        public int Id;
        public String Code;
        public String Name;
    }

    public static class ResBranch
    {
        public int Id;
        public String Code;
        public String Name;
        public int RegionId;
    }

    public static class ResChannel
    {
        public String Code;
        public String Name;
    }

    //城市查询
    public static class QueryCityRequest
    {
        public String Uuid;
        public int BranchId;
    }

    public static class QueryCityResult extends ResultStatus
    {
        public List<ResCity> Cities;
    }

    public static class ResCity
    {
        public int Id;
        public String Code;
        public String Name;
    }

    //查询门店
    public static class QueryCounterRequest
    {
        public String Uuid;
        public String CityCode;
        public String Channel;
        public String CounterName;
        public String BranchCode;
    }

    public static class QueryCounterResult extends ResultStatus
    {
        public List<ResCounter> Counters;
    }   

    public static class ResCounter
    {
        public String Code;
        public String Name;
    }

    //管理员查询拜访列表
    public static class QueryVisitRequest
    {
        public String Uuid;
        public String CounterCode;
    }

    public static class QueryVisitResult extends ResultStatus
    {
        public List<ResQueryVisit> Data;
    }

    public static class ResQueryVisit
    {
        public int Id;
        public String SupervisorCode;
        public String SupervisorName;
        public Date VisitDate;
    }

    //管理员查看拜访内容
    public static class QueryVisitContentRequest
    {
        public String Uuid;
        public int VisitId;
    }

    public static class QueryVisitContentResult extends ResultStatus
    {
        public QueryVisitContentResData Data;
    }

    public static class QueryVisitContentResData
    {
        public short SampleDisplayNum;        //样机出样数量
        public short SampleEmptyNum;          //样机空样数量
        public List<String> ThemeModels;          //主题形象墙出样型号
        public List<String> OvercolorModels;        //流光溢彩墙型号
        public List<String> OtherModels;       //其他出样型号
        public String DemoDigitalStream;       //演示数码流情况

        public String BoothsShape;             //展台形状
        public String BoothsLocation;          //展台信息
        public String BoothsBreakageItem;      //展台破损项目
        public Date BoothsBreakageDate;   //展台破损日期
        public String BoothsBreakageStatus;    //展台破损是否完工
        public String WireExposed;             //连线是否外露
        public String BoothsView;              //展台全景(含照片)
        public String BoothsFacade;            //展台正面(含照片)
        public String BoothsOvercolor;         //展台流光溢彩墙(含照片)


        /*public String SaleMonth;               //销售年月
        public int SaleNum;                    //总金额
        public int SaleAmount;                 //总销量
        public List<DataVisitContentSales> Sales;   //品牌销售*/
        public String SalesDes; //销售加密数据
        public String LedgerGatherStatus;      //台账收集成功:是或否
        public String LedgerCheckStatus;       //台账核对无误:是或否
        public String CounterStockStatus;      //门店库存情况:充足或缺乏
        public List<String> OutOfStockModels;       //缺货型号


        public String SampleCornerPost;        //样机角贴:齐, 缺,破损,不允许
        public String PosterHang;              //海报及吊旗悬挂:齐, 缺,破损,不允许
        public String SinglePage;             //单页:齐, 缺,破损,不允许
        public String StandPileHead;           //X展架及堆头布置:齐, 缺,破损,不允许
        public String ExceptionDetails;        //异常详情

        public List<DataVisitContentSpecial> PosmBackups;  //Posm备用
        public List<DataVisitContentSpecial> Specials;     //特殊任务

        public List<DataVisitContentCompetitor> CompPrices;        //竞品产品价格
        public List<DataVisitContentCompetitor> CompNews;         //新品上市信息(含照片)
        public List<DataVisitContentCompetitor> CompPromotions;    //竞品促销活动(含照片)

        public List<DataVisitContentPromoter> Promoters;    //促销员信息(含照片)
    }

    //促销员内容
    public static class PromoterContentRequest
    {
        public String Uuid;

        public PromoterContentReqData Data;
      
        public List<DataPromoterContentCompetitor> CompPrices;        //竞品产品价格
        public List<DataPromoterContentCompetitor> CompNews;          //新品上市信息
        public List<DataPromoterContentCompetitor> CompPromotions;    //竞品促销活动
    }
    
    public static class PromoterContentReqData
    {
        public List<String> ThemeModels;          	//主题形象墙出样型号
        public List<String> OvercolorModels;        //流光溢彩墙型号
        public List<String> OtherModels;	       	//其他出样型号
        public List<String> OutOfStockModels;       //缺货型号

        public String BoothsView;              //展台全景(照片)
        public String BoothsFacade;            //展台正面(照片)
        public String BoothsOvercolor;         //展台流光溢彩墙(照片)

        public List<DataVisitContentSpecial> Specials;      //特殊任务
    }

    public static class DataPromoterContentCompetitor
    {
        //public int VisitId { get; set; }
    	public String Type;
        public String Brands;
        public String Model;
        public double Price;
        public int SaleNum;
        public String Function;
        public String OtherFunction;
        public String Activity;
        public String OtherActivity;
        public String Photo;
    }
}
